{include file="public/header"/}
{include file="public/navleft"}

<div class="tpl-content-wrapper">
    <div class="tpl-content-page-title">
        报告列表
    </div>
    <ol class="am-breadcrumb">
        <li><a href="{:url('report/index')}" class="am-icon-home">首页</a></li>
        <li><a href="{:url('report/index')}">报告列表</a></li>
        <li class="am-active">报告查询</li>
    </ol>
    <div class="tpl-portlet-components">
        <div class="tpl-block">
            <div class="am-g">
                <div class="am-u-sm-12 am-u-md-3">
                </div>
            </div>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form" method="post" action="{:url('report/DetailReportInfo')}">
                        <div class="am-u-sm-12 am-u-md-8 container">
                            <div class="am-input-group am-input-group-sm">
                                <input type="text" class="am-form-field" placeholder="千麦条码**姓名**医院条码**身份证号码" name="str">
                                <span class="am-input-group-btn">
            <button class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit" ></button>
          </span>
                            </div>
                        </div>

                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <!--<th class="table-check"><input type="checkbox" class="tpl-table-fz-check"></th>-->
                                <!--<th class="table-id">ID</th>-->
                                <th class="table-title">条码</th>
                                <th class="table-author am-hide-sm-only">平台代号</th>
                                <th class="table-title">流水号</th>
                                <th class="table-type">姓名</th>
                                <th class="table-title">检验目的</th>
                                <th class="table-title">采集时间</th>
                                <th class="table-date am-hide-sm-only">样本检验</th>
                                <th class="table-title">状态</th>
                                <th class="table-set">操作</th>
                                <th class="hidden">1</th>
                            </tr>
                            </thead>
                            <tbody>
                            {empty name="ReportRes"}

                            {else /}
                            {volist name="ReportRes" id="data"}
                            <tr>
                                <!-- <td><input type="checkbox"></td>-->
                                <!--<td>1</td>-->
                                <td>{$data.ybid|default='610000123456'}</td>
                                <td>{$data.yqdh|default='666'}</td>
                                <td>{$data.ybbh|default='666'}</td>
                                <td>{$data.brxm|default='zAc'}</td>
                                <!--<td><input style="border:0; text-align: center; width:60px; background: #fff;"
                                           type="text"  value="{$data.brxm|default='新冠核酸'}"/></td>-->
                                <td>{$data.jymd|mb_substr=0,20|default='未知'}</td>
                                <td class="am-hide-sm-only">{$data.cjtime|getDateDay|default='2020-01-02 07:28:47'}</td>
                                <td class="am-hide-sm-only">{$data.cyrq|getDateDay|default='2020-01-02 07:28:47'}</td>
                                <td class="table-title"><a href="#">{$data.ybzt|getYbzt|default='未知'}</a></td>
                                <td>
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">

                                            <button class="am-btn am-btn-default "
                                                    type="button"
                                                    onclick="ModifyReportByYbid('{$data.ybid}','{$data.ybbh}','{$data.cdrq}')"
                                            ><span class="am-icon-pencil-square-o"></span> 信息编辑
                                            </button>


                                            <button class="am-btn am-btn-default "
                                                    type="button"
                                                    onclick="ModifyReportxmcdz('{$data.yqdh}','{$data.cdrq|strtotime}','{$data.ybbh}' )"
                                                    ><span class="am-icon-pencil-square-o"></span> 结果编辑
                                            </button>

                                            <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" id="aa"
                                                    type="button"   onclick="ReportRet('{$data.ybid}')"><span class="am-icon-trash-o"></span>重新生成</button>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            {/volist}
                            {/empty}
                            </tbody>
                        </table>
                        <hr>
                    </form>
                </div>
            </div>
        </div>
        <div class="tpl-alert"></div>
    </div>
    {include file="public/footer"/}
    <script>
        //结果编辑
        function ModifyReportxmcdz(yqdh, cdrq, ybbh) {
            var url = "/index.php/index/report/EditReportXmcdz";
            var data = {'yqdh':yqdh,'ybbh':ybbh,'cdrq':cdrq};
            location.href = '/index.php/index/report/EditReportXmcdz?yqdh='+yqdh+'&cdrq='+cdrq+'&ybbh='+ybbh;
        }


        //信息编辑
        window.ModifyReportByYbid=function(ybid, ybbh, cdrq){
            location.href = '/index.php/index/report/EditReportYbid?ybid='+ybid+'&ybbh='+ybbh+'&cdrq='+cdrq;
        }

        /**
         * 报告修改页面js  重新生成报告单
         * @author singwa
         */

        function ReportRet(ybid) {

            // 获取登录页面中的用户名 和 密码
            /*var ybid = $('input[name="ybid"]').val();*/
            /* var password = $('input[name="password"]').val();*/
            /*layer.alert('ddd');*/
            /*        if(!username) {
                        return dialog.error('用户名不能为空');

                    }
                    if(!password) {
                        return dialog.error('密码不能为空');
                    }*/
            /* return dialog.success('成功', '/index.php/index/index/index');*/

            var url = "/index.php/index/report/ReportRet";
            var data = {'ybid':ybid};
            // 执行异步请求  $.post
            $.post(url,data,function(result){
                if(result.status == 0) {
                    return dialog.error(result.message);
                }
                if(result.status == 1) {
                    /* return dialog.success(result.message, '/index.php/index/index/index');*/

                    return  dialog.full(result.message);
                }

            },'JSON');
        }


    </script>

